<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Perpon{
            constructor(){
                this.name=null;
            }
            getname(){
                console.log(this.name);
                this.test();
            }
            test(){
                console.log('zheshitest');
            }
        }
        const xz=new Perpon();
        xz.name='项总';
        xz.getname() //this指向xz
        const ysg=new Perpon();
        ysg.name='员总';
        ysg.getname();
        // const getName=xz.getname.bind(ysg);
        // getName();
        xz.getname.call(ysg); //call 可以立即执行
    </script>
</body>
</html>